import request from '@/utils/request'

// 查询抽样点调查列表
export function listSurvey(query) {
  console.log(query)
  return request({
    url: '/sampling/querySamplingList',
    method: 'get',
    params: query
  })
}

// 查询抽样点调查详细
export function getSurvey(id) {
  return request({
    url: '/sampling/queryData?id=' + id,
    method: 'get',
  })
}

// // 新增抽样点调查
export function addSurvey(data) {
  return request({
    url: '/system/survey',
    method: 'post',
    data: data
  })
}

// 修改抽样点调查
export function updateSurvey(data) {
  return request({
    url: '/sampling//modifyData',
    method: 'post',
    data: data
  })
}

// 删除抽样点调查
export function delSurvey(id) {
  return request({
    url: '/sampling/deleteById?ids='+ id,
    method: 'post',
  })
}

//地图查询全部抽样点调查列表
export function mapAllListSurvey() {
  return request({
    url: '/sampling/querySamplingMap',
    method: 'get'
  })
}

//地图查询任务ID对应的抽样点调查列表
export function mapGetTaskSurveyList(taskCode) {
  return request({
    url: '/sampling/getSamplingByTaskCode?taskCode='+taskCode,
    method: 'get'
  })
}
